import request from "@/utils/request"
//登录请求
export const login = data => request({
  method: 'POST',
  // url: '/app/v1_0/authorizations',
  url: "/v1_0/authorizations",
  data
})
//获取用户信息
export const userInfo = params => request({
  // url: '/mp/v1_0/user/profile',
  url: "/v1_0/user"
})
//发送验证码
export const sendCode = mobile => request({
  url: `/v1_0/sms/codes/${mobile}`
})
//获取用户资料
export const getUserInfo = () => request({
  url: '/v1_0/user/profile'
})
//编辑用户资料
export const editUserInfo = data => request({
  url: '/v1_0/user/profile',
  method: 'PATCH',
  data
})
export const editPhoto = data => request({
  url: '/v1_0/user/photo',
  method: 'PATCH',
  data
})
export const refreshToken = () => request({
  url: '/v1_0/authorizations',
  method: 'PUT',
  isRefreshToken: true
})